home *** CD-ROM | disk | FTP | other *** search
-
- > I tried out this routine last night and with some small modifications it worked.
- > The logic was spot on, just some syntax and spelling problems.
- >
- > I couldn't get the "pop proc[1]" type statement working nor could I find
- > reference to using pop proc in this manner. Please enlighten me if this
- > is possible. I simply used:
- >
- > ; button declared as global
- > button=1
- > pop proc
- >
-
-
- Perhaps that is AMOSPro only. A better style than yours is instead of
- making button global, put "End Proc[button]" on the end of the procedure,
- and delete all the pop procs. Since the code is all in a big IF ELSE ENDIF
- statement, the logic will not change when you do this. End Proc[] definitely
- works in all versions of AMOS. You can then call the procedure with:
-
- TESTBUTTONPRESS[STICK] : BUTTON=Param
-
-
- > I think I had problems with the START_TIME variable name as it clashed with a
- > reserved word so I just used BEGIN_TIME.
- >
- > Where Paul used "If START_TIME" I used "If BEGIN_TIME<>0".
- > Are these If's testing the same thing? (notwithstanding my change of variable name)
-
- Yes. AMOS simply evaluates the BEGIN_TIME<>0 to either -1 (True) or 0 (False)
- before considering the if, then the IF command looks at its now numeric
- argument, and checks if it is non zero. Therefore to check for a variable
- begin non-zero, you use IF <VARIABLE> and to check for a variable being zero,
- you can use IF Not <VARIABLE>. I admit that it is better style to use <> 0
- for numbers, but my style should be used for boolean variables.
-
- >
- > I would also like to test for the joystick being held or pressed to the left or right
- > or just tapped as well as the button being tested in this manner. Later I will probably
- > want to do the same for up and down!
- >
- > Q1. Should I incorporate all of this in the one procedure which checks every feature of
- > the joystick in one test of the joy(1) function or should I write seperate procedures.
- >
-
- Using Jleft/Jright etc. is not significantly faster or slower than joy(). As
- to the number of procedures, use whatever works best for you. Be aware that
- having many very small procedures will be slightly slower.
-
- > Max Monahan
- > M.Monahan@bom.gov.au
- >
-
-
- +-------------------------+------------------------------------+
- | | _____ |
- | PAUL HICKMAN | / \ ON A HOT SUMMER NIGHT |
- | (ph@doc.ic.ac.uk) | / O O \ WOULD YOU OFFER YOUR |
- | DEPARTMENT OF COMPUTING | | _ | THROAT TO THE WOLF |
- | IMPERIAL COLLEGE LONDON | \ / \ / WITH THE RED ROSES ? |
- | | \_____/ |
- +-------------------------+------------------------------------+
- Machines: Amiga 500 WB1.3 - 1mb Memory - External Disk Drive.
- Amiga 1200 WB3.0 - 6mb Memory - 200Mb Hard Disk.
-
-
-